/*

Rand test  : adventurer card

*/


#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1



int main() {


    int i=1;
    int idx=100;


    int seed = 1000;
    int numPlayer = 4;
    int r;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;

  while (i<1000){

    memset(&G, 23, sizeof(struct gameState));   // clear the game state
    r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
    //testing drawed treasure from 0 1 2 3

  int drawntreasure=0;
  // test 0 1 2 3 
  int currentPlayer = 0; // set the game as 2 player game, rand test for player 0 1 2 
 

  int cardDrawn=0;// does not change anything

  int temphand[MAX_HAND]; // does not do anything
  int z = 0;// does not do anything
  

	currentPlayer = rand()%4;
	//the card from drawntreasure till end of the card should be all treasure cards after the adv card.
	printf("\ntesting player %d",currentPlayer);
	zzzadventurercardplay(drawntreasure, currentPlayer, cardDrawn, temphand, z,
				&G);
	if(isatreasurer(&G,currentPlayer)!=1){
		printf("card error! is treasure = %d\n",isatreasurer(&G,currentPlayer));
		exit(0);	
	}
	i++;
  }


    return 0;
}
